﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Pot3a00
    {
		private string _listid;
		private string _productcode;
		private string _productname;
		private string _barcode;
		private string _pvlistid;
		private string _ptlistid;
		private string _ptype;
        private int? _status;
		private string _ulistid;
		private string _brand;
		private string _leverid;
		private double _price;
		private double _bordqty;
		private string _taxid;
		private double _bprice;
        private int? _calcode;
		private double _pamt;
		private double _pct;
		private double _storageqty;
		private double _wayqty;
		private double _nowqty;
        private DateTime? _condate;
        private DateTime? _outdate;
		private string _muser;
		private string _spc;
		private double _bpricetax;
		private double _pamtax;
		private double _tranwayqty;
		
        /// <summary>
        /// 商品主键
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 商品代码
        /// </summary>
		public string Productcode
		{
			get { return _productcode;	 }
			set { _productcode=value;	}
		}
        /// <summary>
        /// 商品名称
        /// </summary>
		public string Productname
		{
			get { return _productname;	 }
			set { _productname=value;	}
		}
        /// <summary>
        /// 条形码
        /// </summary>
		public string Barcode
		{
			get { return _barcode;	 }
			set { _barcode=value;	}
		}
        /// <summary>
        /// 结构主键
        /// </summary>
		public string Pvlistid
		{
			get { return _pvlistid;	 }
			set { _pvlistid=value;	}
		}
        /// <summary>
        /// 商品属性
        /// </summary>
		public string Ptlistid
		{
			get { return _ptlistid;	 }
			set { _ptlistid=value;	}
		}
        /// <summary>
        /// 商品类型
        /// </summary>
		public string Ptype
		{
			get { return _ptype;	 }
			set { _ptype=value;	}
		}
        /// <summary>
        /// 状态
        /// </summary>
		public int? Status
		{
			get { return _status;	 }
			set { _status=value;	}
		}
        /// <summary>
        /// 单位
        /// </summary>
		public string Ulistid
		{
			get { return _ulistid;	 }
			set { _ulistid=value;	}
		}
        /// <summary>
        /// 品牌主键
        /// </summary>
		public string Brand
		{
			get { return _brand;	 }
			set { _brand=value;	}
		}
        /// <summary>
        /// 等级标识
        /// </summary>
		public string Leverid
		{
			get { return _leverid;	 }
			set { _leverid=value;	}
		}
        /// <summary>
        /// 进价
        /// </summary>
		public double Price
		{
			get { return _price;	 }
			set { _price=value;	}
		}
        /// <summary>
        /// 起订数量
        /// </summary>
		public double Bordqty
		{
			get { return _bordqty;	 }
			set { _bordqty=value;	}
		}
        /// <summary>
        /// 税率
        /// </summary>
		public string Taxid
		{
			get { return _taxid;	 }
			set { _taxid=value;	}
		}
        /// <summary>
        /// 出货价
        /// </summary>
		public double Bprice
		{
			get { return _bprice;	 }
			set { _bprice=value;	}
		}
        /// <summary>
        /// 成本核算方式
        /// </summary>
		public int? Calcode
		{
			get { return _calcode;	 }
			set { _calcode=value;	}
		}
        /// <summary>
        /// 成本
        /// </summary>
		public double Pamt
		{
			get { return _pamt;	 }
			set { _pamt=value;	}
		}
        /// <summary>
        /// 毛利率
        /// </summary>
		public double Pct
		{
			get { return _pct;	 }
			set { _pct=value;	}
		}
        /// <summary>
        /// 库存
        /// </summary>
		public double Storageqty
		{
			get { return _storageqty;	 }
			set { _storageqty=value;	}
		}
        /// <summary>
        /// 在途量
        /// </summary>
		public double Wayqty
		{
			get { return _wayqty;	 }
			set { _wayqty=value;	}
		}
        /// <summary>
        /// 今日发货量
        /// </summary>
		public double Nowqty
		{
			get { return _nowqty;	 }
			set { _nowqty=value;	}
		}
        /// <summary>
        /// 收货日期
        /// </summary>
		public DateTime? Condate
		{
			get { return _condate;	 }
			set { _condate=value;	}
		}
        /// <summary>
        /// 出货日期
        /// </summary>
		public DateTime? Outdate
		{
			get { return _outdate;	 }
			set { _outdate=value;	}
		}
        /// <summary>
        /// 用户标识
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 规格
        /// </summary>
		public string Spc
		{
			get { return _spc;	 }
			set { _spc=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public double Bpricetax
		{
			get { return _bpricetax;	 }
			set { _bpricetax=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public double Pamtax
		{
			get { return _pamtax;	 }
			set { _pamtax=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public double Tranwayqty
		{
			get { return _tranwayqty;	 }
			set { _tranwayqty=value;	}
		}
		
		public static List<Pot3a00> GetPot3a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Pot3a00> list = new List<Pot3a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Pot3a00 model = GetPot3a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Pot3a00 GetPot3a00ByDataRow(DataRow dr)
		{
			Pot3a00 model = new Pot3a00(); //实例化Pot3a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			if (dcc.Contains("productcode")&&!(dr["productcode"] is System.DBNull))  
				model.Productcode = ( string)dr["productcode"];
			if (dcc.Contains("productname")&&!(dr["productname"] is System.DBNull))  
				model.Productname = ( string)dr["productname"];
			if (dcc.Contains("barcode")&&!(dr["barcode"] is System.DBNull))  
				model.Barcode = ( string)dr["barcode"];
			if (dcc.Contains("pvlistid")&&!(dr["pvlistid"] is System.DBNull))  
				model.Pvlistid = ( string)dr["pvlistid"];
			if (dcc.Contains("ptlistid")&&!(dr["ptlistid"] is System.DBNull))  
				model.Ptlistid = ( string)dr["ptlistid"];
			if (dcc.Contains("ptype")&&!(dr["ptype"] is System.DBNull))  
				model.Ptype = ( string)dr["ptype"];
			if (dcc.Contains("status")&&!(dr["status"] is System.DBNull))  
				model.Status = ( int)dr["status"];
			if (dcc.Contains("ulistid")&&!(dr["ulistid"] is System.DBNull))  
				model.Ulistid = ( string)dr["ulistid"];
			if (dcc.Contains("brand")&&!(dr["brand"] is System.DBNull))  
				model.Brand = ( string)dr["brand"];
			if (dcc.Contains("leverid")&&!(dr["leverid"] is System.DBNull))  
				model.Leverid = ( string)dr["leverid"];
			if (dcc.Contains("price")&&!(dr["price"] is System.DBNull))  
				model.Price = Convert.ToDouble(dr["price"]);
			if (dcc.Contains("bordqty")&&!(dr["bordqty"] is System.DBNull))  
				model.Bordqty = Convert.ToDouble(dr["bordqty"]);
			if (dcc.Contains("taxid")&&!(dr["taxid"] is System.DBNull))  
				model.Taxid = ( string)dr["taxid"];
			if (dcc.Contains("bprice")&&!(dr["bprice"] is System.DBNull))  
				model.Bprice = Convert.ToDouble(dr["bprice"]);
			if (dcc.Contains("calcode")&&!(dr["calcode"] is System.DBNull))  
				model.Calcode = ( int)dr["calcode"];
			if (dcc.Contains("pamt")&&!(dr["pamt"] is System.DBNull))  
				model.Pamt = Convert.ToDouble(dr["pamt"]);
			if (dcc.Contains("pct")&&!(dr["pct"] is System.DBNull))  
				model.Pct = Convert.ToDouble(dr["pct"]);
			if (dcc.Contains("storageqty")&&!(dr["storageqty"] is System.DBNull))  
				model.Storageqty = Convert.ToDouble(dr["storageqty"]);
			if (dcc.Contains("wayqty")&&!(dr["wayqty"] is System.DBNull))  
				model.Wayqty = Convert.ToDouble(dr["wayqty"]);
			if (dcc.Contains("nowqty")&&!(dr["nowqty"] is System.DBNull))  
				model.Nowqty = Convert.ToDouble(dr["nowqty"]);
			if (dcc.Contains("condate")&&!(dr["condate"] is System.DBNull))  
				model.Condate = ( DateTime)dr["condate"];
			if (dcc.Contains("outdate")&&!(dr["outdate"] is System.DBNull))  
				model.Outdate = ( DateTime)dr["outdate"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("spc")&&!(dr["spc"] is System.DBNull))  
				model.Spc = ( string)dr["spc"];
			if (dcc.Contains("bpricetax")&&!(dr["bpricetax"] is System.DBNull))  
				model.Bpricetax = Convert.ToDouble(dr["bpricetax"]);
			if (dcc.Contains("pamtax")&&!(dr["pamtax"] is System.DBNull))  
				model.Pamtax = Convert.ToDouble(dr["pamtax"]);
			if (dcc.Contains("tranwayqty")&&!(dr["tranwayqty"] is System.DBNull))  
				model.Tranwayqty = Convert.ToDouble(dr["tranwayqty"]);
			
			return model;
		}
    }
}
